package com.goktech.olala.core.service.impl;

import com.goktech.olala.core.service.IPictureService;
import com.goktech.olala.server.dao.goods.PictureMapper;
import com.goktech.olala.server.pojo.goods.Picture;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Classname IPictureServiceImp
 * @Description TODO
 * @Date 2020/12/21 9:20
 * @Created by ASUS
 */
@Service
public class IPictureServiceImp implements IPictureService {

    @Autowired
    PictureMapper pictureMapper;

    @Override
    public int deleteByPrimaryKey(Long pictureId) {
        int i = pictureMapper.deleteByPrimaryKey(pictureId);
        return i;
    }

    @Override
    public int insert(Picture record) {
        int insert = pictureMapper.insert(record);
        return insert;
    }

    @Override
    public Picture selectByPrimaryKey(Integer pictureId) {
        Picture picture = pictureMapper.selectByPrimaryKey(pictureId);
        return picture;
    }

    @Override
    public List<Picture> selectAll() {
        List<Picture> pictures = pictureMapper.selectAll();
        return pictures;
    }

    @Override
    public int updateByPrimaryKey(Picture record) {
        int i = pictureMapper.updateByPrimaryKey(record);
        return i;
    }

    @Override
    public List<Picture> selectByGoodsId(String relationId) {
        List<Picture> pictureList = pictureMapper.selectByGoodsId(relationId);
        return pictureList;
    }
}
